Replacing LaTeX custom norms to avoid new command

Metadata
aliases: []
shorthands: {}
created: 2022-01-11 17:32:50
modified: 2022-01-16 18:06:44

The following \newcommand definition can be used to define a norm macro in LaTeX:

\newcommand{\norm}[1]{\left\lVert#1\right\rVert}

This produces some nice automatically resizing double verticals. The problem is that Obsidian does not handle custom definitions well, so I needed to replace the \norm{…} commands all throughout a document. This could be easily done with the following regex and replace pair:

\\norm\{([^}]+)\}

This pattern found all the \norm{…} commands, then the replacer was:

\\left\\lVert $1 \\right\\rVert

This was used in VSCode.